﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Reflection;

namespace MedicalSystem.SamrtReport
{
    public partial class HorizontalMobileReaderFrm : Form
    {
        #region Test Method
        private void MakeSomeTestData()
        {
            DataRow dr = this.DataSet.Tables["Employee"].NewRow();
            dr["ID"] = "0";
            dr["Name"] = "employee1";
            dr["Age"] = "22";
            dr["OrganizactionID"] = "0";
            this.DataSet.Tables["Employee"].Rows.Add(dr);

            DataRow dr1 = this.DataSet.Tables["Organizaction"].NewRow();
            dr1["OrganizactionID"] = "0";
            dr1["OrganizactionName"] = "Organizaction1";
            dr1["Leader"] = "leader1";

            DataRow dr2 = this.DataSet.Tables["Organizaction"].NewRow();
            dr2["OrganizactionID"] = "1";
            dr2["OrganizactionName"] = "Organizaction2";
            dr2["Leader"] = "leader2";

            this.DataSet.Tables["Organizaction"].Rows.Add(dr1);
            this.DataSet.Tables["Organizaction"].Rows.Add(dr2);
        }
        #endregion

        public DataSet _dataset=new DataSet();
        public DataSet DataSet
        {
            get { return _dataset; }
            set { _dataset = value; }
        }

        private string _fileName;

        public HorizontalMobileReaderFrm(string fileName)
        {
            InitializeComponent();
            this._fileName = fileName;
            //_dataset.ReadXmlSchema(Application.StartupPath + @"\DataSet.xml");

           // MakeSomeTestData();
        }
        
       
      
        private void FReader_Load(object sender, EventArgs e)
        {

            //this.reportViewer1.DataSet = this.DataSet;
            //this.reportViewer1.ReportClientId = "1";
            //this.reportViewer1.LoadReport("TestReport");
            this.reportViewer1.Preview(_fileName);
              
         }
       


        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataSet ss = this.DataSet;

          // this.reportViewer1.Submit("0001");
           MessageBox.Show("表单已提交");
            
        }
       
        
    }
}